/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bd_imss;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Earving
 */
@Entity
@Table(name = "clinicas")
@NamedQueries({
    @NamedQuery(name = "Clinicas.findAll", query = "SELECT c FROM Clinicas c"),
    @NamedQuery(name = "Clinicas.findByIdClinica", query = "SELECT c FROM Clinicas c WHERE c.idClinica = :idClinica"),
    @NamedQuery(name = "Clinicas.findByNombre", query = "SELECT c FROM Clinicas c WHERE c.nombre = :nombre"),
    @NamedQuery(name = "Clinicas.findByDireccion", query = "SELECT c FROM Clinicas c WHERE c.direccion = :direccion"),
    @NamedQuery(name = "Clinicas.findByEstado", query = "SELECT c FROM Clinicas c WHERE c.estado = :estado"),
    @NamedQuery(name = "Clinicas.findByMunicipio", query = "SELECT c FROM Clinicas c WHERE c.municipio = :municipio")})
public class Clinicas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_clinica")
    private Integer idClinica;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @Column(name = "direccion")
    private String direccion;
    @Basic(optional = false)
    @Column(name = "estado")
    private String estado;
    @Column(name = "municipio")
    private String municipio;
    @OneToMany(mappedBy = "clinicas")
    private List<Pacientes> pacientesList;
    @OneToMany(mappedBy = "clinicas")
    private List<Citas> citasList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "clinicas")
    private List<Consultorios> consultoriosList;

    public Clinicas() {
    }

    public Clinicas(Integer idClinica) {
        this.idClinica = idClinica;
    }

    public Clinicas(Integer idClinica, String nombre, String direccion, String estado) {
        this.idClinica = idClinica;
        this.nombre = nombre;
        this.direccion = direccion;
        this.estado = estado;
    }

    public Integer getIdClinica() {
        return idClinica;
    }

    public void setIdClinica(Integer idClinica) {
        this.idClinica = idClinica;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public String getEstado() {
        return estado;
    }

    public void setEstado(String estado) {
        this.estado = estado;
    }

    public String getMunicipio() {
        return municipio;
    }

    public void setMunicipio(String municipio) {
        this.municipio = municipio;
    }

    public List<Pacientes> getPacientesList() {
        return pacientesList;
    }

    public void setPacientesList(List<Pacientes> pacientesList) {
        this.pacientesList = pacientesList;
    }

    public List<Citas> getCitasList() {
        return citasList;
    }

    public void setCitasList(List<Citas> citasList) {
        this.citasList = citasList;
    }

    public List<Consultorios> getConsultoriosList() {
        return consultoriosList;
    }

    public void setConsultoriosList(List<Consultorios> consultoriosList) {
        this.consultoriosList = consultoriosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idClinica != null ? idClinica.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Clinicas)) {
            return false;
        }
        Clinicas other = (Clinicas) object;
        if ((this.idClinica == null && other.idClinica != null) || (this.idClinica != null && !this.idClinica.equals(other.idClinica))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bd_imss.Clinicas[idClinica=" + idClinica + "]";
    }

}
